home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
taropyon
/
guilib3
/
inc
/
fdl.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-30
|
9KB
|
279 lines
/* :*****************************************************************
: "fdl.h" : ファイルダイアログ・ライブラリ
:*****************************************************************
*/
#ifndef _FDL_H
#define _FDL_H
#ifndef _SPDEFS_H
# include <spdefs.h>
#endif
#ifndef _MOUSE_H
# include <mouse.h>
#endif
#ifndef _EVENT_H
# include <event.h>
#endif
#ifndef _DIALOG_H
# include <dialog.h>
#endif
#ifndef _SBAR_H
# include <sbar.h>
#endif
#ifndef _GST_H
# include <gst.h>
#endif
/*--------------------------------------------------------------------
ドライブアイコン構造体
--------------------------------------------------------------------*/
typedef struct _fdlDrvIcn_t /* ドライブ情報保存用 */
{
struct _fdlDrvIcn_t *next;
SHORT drv; /* ドライブ番号 */
SHORT typ; /* 種別 */
SHORT iconNo; /* アイコン番号(24×24アイコン) */
SHORT x0, y0; /* 表示位置 */
SHORT xs, ys; /* アイコンの大きさ */
SHORT pixel; /* ピクセル数 */
char *dat; /* データ */
} FDLDRVICN_T;
extern FDLDRVICN_T *FdlDrvIcnTop;
/*--------------------------------------------------------------------
ファイル名バッファ
--------------------------------------------------------------------*/
typedef struct _flbuf_t
{
struct _flbuf_t *next;
int no; /* ソートなし用の番号 */
int flag; /* ワイルドカード選択用 */
int mark; /* ユーザー選択用 */
unsigned int att; /* ファイル属性 */
USHORT time,date; /* タイムスタンプ */
size_t size; /* ファイルサイズ */
char name[16]; /* ファイル名 */
SHORT type; /* ファイルタイプ(テキスト,EUP,TIF) */
SHORT icon; /* アイコン番号 */
} _FLBUF_T;
/*--------------------------------------------------------------------
拡張子ごとのファイルのタイプ定義する構造体
--------------------------------------------------------------------*/
typedef struct _flobj_t
{
struct _flobj_t *next;
int type; /* タイプ番号 */
char name[16]; /* ファイル名(拡張子) */
} _FLOBJ_T;
/*--------------------------------------------------------------------
階層ファイルリスタ構造体
--------------------------------------------------------------------*/
typedef struct _flst_t
{
struct _flst_t *next, *prev;
/* struct _flst_t *child, *parent; */
FRAME fr; /* 表示枠 */
EVT_T *evt; /* イベント */
EVT_T *selEvt; /* ファイル選択用イベント */
SBAR_T *sb; /* スクロールバー */
char name[16]; /* 現ディレクトリ名 */
int drv;
char whare[128]; /* ディレクトリ */
char path[128]; /* パス名 */
char dspFlag; /* 表示されているか? */
char redspIgn; /* 再表示の必要なし */
char _dmy_2;
char _dmy_3;
int dspTop;
int dspYm;
_FLBUF_T *flTop;
_FLBUF_T **flBuf;
int allNum;
int fileNum;
int dirNum;
int pickNum;
void *fdl;
int error;
CONST char *errMsg;
} _FLST_T;
/*--------------------------------------------------------------------
マークファイル
--------------------------------------------------------------------*/
typedef struct _fdlmak_t
{
struct _fdlmak_t *next;
int no; /* マークされた順番 */
unsigned int att; /* ファイル属性 */
USHORT time,date; /* タイムスタンプ */
size_t size; /* ファイルサイズ */
char fn[128];
} FDLMAK_T;
#define FDLMAK_HASH_MAX (64)
/*--------------------------------------------------------------------
ファイルスタック
--------------------------------------------------------------------*/
typedef struct _fdlstk_t
{
struct _fdlstk_t *next;
char fn[1];
} FDLSTK_T;
/*--------------------------------------------------------------------
ファイルダイアログ構造体
--------------------------------------------------------------------*/
#define FDL_GSTBUF_LEN (128)
typedef struct _fdl_t
{
unsigned cd; /* 状態フラグ */
int drv; /* ドライブ */
char whare[128]; /* ディレクトリ */
char wild[128]; /* ワイルドカード */
int sort; /* ソート種別 */
int dspTyp; /* 表示タイプ */
char fvwDspFlag; /* ファイルビュワー表示フラグ */
char fvwClsFlag;
SHORT fvwYs; /* ファイルビュワの縦サイズ */
FRAME fvwFr; /* ファイルビュワー表示枠 */
SHORT fvwDmy1, fvwDmy2;
size_t fvwBufSiz;
char *fvwBuf;
_FLST_T *fvwFlst;
char multiSelFlag; /* 複数選択フラグ */
char _dmy_flag_1;
char _dmy_flag_2;
char _dmy_flag_3;
int page; /* 表示ページ */
DLG_T *dlg; /* ダイアログ構造体 */
FRAME fr;
MOSTKP_T *mosTk;
char *title; /* タイトル */
COLOR *colTbl;
EVT_T *evt; /* ベースイベント */
EVT_T *evtDrv; /* ドライブイベント */
GST_T *gst; /* 文字列入力用 */
char gstBuf[FDL_GSTBUF_LEN+4];
FRAME msFr; /* メインスクリーンフレーム */
SBAR_T *flstSb; /* スクロールバー用 */
_FLST_T *flstTop; /* ファイルリスター */
_FLST_T *flstCrt; /* 現在ファイルリスタ */
int flstNum; /* ファイルリスタの数 */
int flstDspNo; /* 表示先頭番号 */
int flstDspNum; /* 画面内に表示できる数 */
int makNum; /* マークされているファイル数 */
FDLMAK_T *makHashBuf[FDLMAK_HASH_MAX];
/* ハッシュバッファ */
int stkMax; /* スタック保持最大数 */
int stkNum; /* 現在のスタック保持数 */
FDLSTK_T *stkTop; /* ファイル名スタック */
int error;
CONST char *errMsg;
int cx, cy; /* カーソル位置 */
} FDL_T;
/*--------------------------------------------------------------------
ファイルダイアログの動作モードを指定するマクロ
--------------------------------------------------------------------*/
#define FDL_MODE_SINGLE (0x0000_0001) /* ファイルをひとつだけ選択/指定 */
#define FDL_MODE_MULTI (0x0000_0002) /* 複数選択/指定 */
#define FDL_MODE_PATH (0x0000_0003) /* ディレクトリ選択/指定 */
#define FDL_MODE_BIT_DIRIGN (0x0000_0080) /* サブディレクトリの選択/指定を禁止 */
#define FDL_MODE_BIT_DUPIGN (0x0000_0800) /* 同一ファイル1の選択を禁止する */
#define FDL_MODE_BIT_EXIST (0x0000_8000) /* 存在するファイルのみ選択可能 */
#define FDL_MODE_BIT_SIDEWORK (0x0001_0000) /* サイドーク */
#define FDL_MODE_BIT_DOSCALL (0x0002_0000) /* DOS コマンド */
#define FDL_MODE_DEFAULT (FDL_MODE_SINGLE|FDL_MODE_BIT_DIRIGN|FDL_MODE_BIT_SIDEWORK)
#define FDL_SORT_OFF (0) /* ソートなし */
#define FDL_SORT_FILE (1) /* ファイル名 */
#define FDL_SORT_SUB (2) /* 拡張子 */
#define FDL_SORT_DATE (3) /* 日付 */
#define FDL_SORT_SIZE (4) /* サイズ */
#define FDL_SORT_RVS (0x80) /* 昇順/降順 */
#define FDL_SORT_DIRBIT (0x60)
#define FDL_SORT_DIRTOP (0x00) /* ディレクトリ先頭 */
#define FDL_SORT_DIRLAST (0x20) /* ディレクトリ最後 */
#define FDL_SORT_DIROFF (0x40) /* ディレクトリ */
#define FDL_ISSORT_DIRTOP(_sort) (((_sort)&FDL_SORT_DIRBIT) == FDL_SORT_DIRTOP)
#define FDL_ISSORT_DIRLAST(_sort) (((_sort)&FDL_SORT_DIRBIT) == FDL_SORT_DIRLAST)
#define FDL_ISSORT_DIROFF(_sort) (((_sort)&FDL_SORT_DIRBIT) == FDL_SORT_DIROFF)
/* "fdl.h" ----------------------------------------------------*/
extern int FdlDefaultSort;
extern FDLDRVICN_T *FdlDrvIcnTop;
extern int FDL_sysInit(void);
extern void FDL_sysEnd(void);
/* "fdl010.c" ------------------------------------------------*/
extern int FDL_set_gstWork( FDL_T *fdl, HIST_T *histSys );
extern FDL_T *FDL_open( unsigned int cd );
extern int FDL_set_title( FDL_T *fdl, CONST char *form, ... );
extern char *FDL_get_filename( FDL_T *fdl );
extern int FDL_close(FDL_T *fdl);
/* "fdl011.c" ------------------------------------------------*/
extern int FDL_set_defaultFilename( FDL_T *fdl, CONST char *fn );
/* "fdl012.c" ------------------------------------------------*/
extern int FDL_set_wildcard( FDL_T *fdl, CONST char *wild );
/* "fdl013.c" ------------------------------------------------*/
extern int FDL_set_defaultMarkFile( FDL_T *fdl, CONST char *fn );
/* "fdl014.c" ------------------------------------------------*/
extern int Fdl_set_sidework( int (*func)() );
/* "fdl015.c" ------------------------------------------------*/
extern int Fdl_set_doscall( int (*openFunc)(void (*)()), void (*closeFunc)(), int (*systemFunc)(CONST char *));
/* "fdl016.c" ------------------------------------------------*/
extern int FDL_set_startPath( FDL_T *fdl, int drv, CONST char *whare );
/* "fdl017.c" ------------------------------------------------*/
extern int Fdl_set_helpFunc( int (*func)(int,EVTSBJ_T *) );
/* "fdl018.c" ------------------------------------------------*/
extern int FDL_resetDrvSetup(void);
/* "fdldicnc" ------------------------------------------------*/
extern FDLDRVICN_T *FDL_getDrvSetup(void);
extern void FDL_drvMosCurType( FDLDRVICN_T *drvIcn, int drv );
/* "fdlstart.c" ------------------------------------------------*/
extern int FDL_start( FDL_T *fdl );
/* "fdlwild.c" ------------------------------------------------*/
extern int FdlSetWildCardList( CONST char *wild );
extern int FdlSetWildCardHis( CONST char *wild );
extern char *FdlWildCardMenu( int x0, int y0, char *wild );
#endif